@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <button class="btn" onclick="history.go(-1);">
                            <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
                        </button>
                        生命密码管理-修改</div>

                    <div class="panel-body">
                        @if (session('status'))
                            <div class="alert alert-success">
                                {{ session('status') }}
                            </div>
                        @endif
                            <form class="form-horizontal" method="POST" action="{{ route('talent_update') }}">
                                {{ csrf_field() }}

                                <h3 class="panel_title">基础字段</h3>

                                <input type="hidden" name="id" value="{{ $talent->id }}">
                                <div class="form-group{{ $errors->has('main_number') ? ' has-error' : '' }}">
                                    <label for="email" class="col-md-4 control-label">主数字</label>

                                    <div class="col-md-6">
                                        <input id="main_number" type="number" class="form-control" name="main_number"
                                               value="{{ $talent->main_number }}"
                                               required autofocus>

                                        @if ($errors->has('main_number'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('main_number') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('brief') ? ' has-error' : '' }}">
                                    <label for="password" class="col-md-4 control-label">一句话描述</label>

                                    <div class="col-md-6">
                                        <input id="brief" type="text" class="form-control"
                                               value="{{ $talent->brief }}"
                                                       name="brief"
                                                required>

                                        @if ($errors->has('brief'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('brief') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('description') ? ' has-error' : '' }}">
                                    <label for="description" class="col-md-4 control-label">详细描述</label>

                                    <div class="col-md-6">
                                        <textarea name="description"
                                                  id="description" style="display: none;">{{ $talent->description }}</textarea>

                                        @if ($errors->has('description'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('description') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('career_path') ? ' has-error' : '' }}">
                                    <label for="career_path" class="col-md-4 control-label">职业方向</label>

                                    <div class="col-md-6">
                                        <textarea name="career_path"
                                                  id="career_path" style="display: none;">{{ $talent->career_path }}</textarea>

                                        @if ($errors->has('career_path'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('career_path') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('guiding_strategy') ? ' has-error' : '' }}">
                                    <label for="guiding_strategy" class="col-md-4 control-label">引导策略</label>

                                    <div class="col-md-6">
                                        <textarea name="guiding_strategy" id="guiding_strategy"
                                                  style="display: none;">{{ $talent->guiding_strategy }}</textarea>

                                        @if ($errors->has('guiding_strategy'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('guiding_strategy') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>



                                <div class="form-group{{ $errors->has('little_more') ? ' has-error' : '' }}">
                                    <label for="little_more" class="col-md-4 control-label">多数性格</label>

                                    <div class="col-md-6">
                                        <textarea name="little_more"
                                                  id="little_more" style="display: none;">{{ $talent->little_more }}</textarea>

                                        @if ($errors->has('little_more'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('little_more') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('little_less') ? ' has-error' : '' }}">
                                    <label for="little_less" class="col-md-4 control-label">缺数性格</label>

                                    <div class="col-md-6">
                                        <textarea name="little_less" id="little_less" style="display: none;">{{ $talent->little_less }}</textarea>

                                        @if ($errors->has('little_less'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('little_less') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>


                                <h3 class="panel_title">课程相关字段</h3>


                                <div class="form-group{{ $errors->has('parents_common_course') ? ' has-error' : '' }}">
                                    <label for="parents_common_course" class="col-md-4 control-label">父母基础课程</label>

                                    <div class="col-md-6">
                                        <textarea name="parents_common_course" id="parents_common_course" style="display: none;">{{ $talent->parents_common_course }}</textarea>

                                        @if ($errors->has('parents_common_course'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('parents_common_course') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('kids_common_course') ? ' has-error' : '' }}">
                                    <label for="kids_common_course" class="col-md-4 control-label">孩子基础课程</label>

                                    <div class="col-md-6">
                                        <textarea name="kids_common_course" id="kids_common_course" style="display: none;">{{ $talent->kids_common_course }}</textarea>

                                        @if ($errors->has('kids_common_course'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('kids_common_course') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="form-group{{ $errors->has('kids_personal_course') ? ' has-error' : '' }}">
                                    <label for="kids_personal_course" class="col-md-4 control-label">孩子个性课程</label>

                                    <div class="col-md-6">
                                        <textarea name="kids_personal_course" id="kids_personal_course" style="display: none;">{{ $talent->kids_personal_course }}</textarea>

                                        @if ($errors->has('kids_personal_course'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('kids_personal_course') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>



                                <div class="form-group">
                                    <div class="col-md-8 col-md-offset-4">
                                        <button type="submit" class="btn btn-primary">
                                            保存
                                        </button>
                                    </div>
                                </div>
                            </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
@section('script')
    <script type="text/javascript">
        layui.use('layedit', function(){
            var layedit = layui.layedit;
            layedit.build('description'); //建立编辑器
            layedit.build('career_path'); //建立编辑器
            layedit.build('guiding_strategy'); //建立编辑器
            layedit.build('little_more'); //建立编辑器
            layedit.build('little_less'); //建立编辑器
            layedit.build('parents_common_course'); //建立编辑器
            layedit.build('kids_common_course'); //建立编辑器
            layedit.build('kids_personal_course'); //建立编辑器
        });
    </script>

@endsection

